<?php

class Response
{
    const SUCCESS = "Thành công";
    const Fail = "Thất bại";

    private $success = false;
    private $message = null;
    private $data = null;


    public function __construct($success = false, $message = null, $data = null) {
        $this->success = $success;
        $this->message = $message;
        $this->data = $data;
    }

    public function setData($data)
    {
        $this->data = $data;
    }

    public function getData()
    {
        return $this->data;
    }

    public function setMessage($message)
    {
        $this->message = $message;
    }

    public function getMessage()
    {
        return $this->message;
    }

    public function setSuccess($success)
    {
        $this->success = $success;
    }

    public function getSuccess()
    {
        return $this->success;
    }

    public function resultData() {
        $objec["success"] = $this->success;
        $objec["message"] = $this->message;
        $objec["data"] = $this->data;
        return json_encode($objec);
    }
}
